load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "colinfo",
    srcs = [
        "col_type_info.go",
        "column_item_resolver.go",
        "column_resolver.go",
        "column_type_properties.go",
        "data_source.go",
        "doc.go",
        "ordering.go",
        "result_columns.go",
        "system_columns.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/encoding",
        "//pkg/util/errorutil/unimplemented",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
        "@org_golang_x_text//language",
    ],
)

go_test(
    name = "colinfo_test",
    size = "small",
    srcs = [
        "column_item_resolver_test.go",
        "column_type_properties_test.go",
        "result_columns_test.go",
    ],
    embed = [":colinfo"],
    deps = [
        "//pkg/sql/catalog/colinfo/colinfotestutils",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_stretchr_testify//require",
    ],
)
